﻿using MediatR;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using S.PurchaseAndSales.Domain.Enum;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace S.PurchaseAndSales.Api.Application.Command.PurchaseFormCommand
{
    /// <summary>
    ///采购 修改
    /// </summary>
    public class PurchaseFormUpdateCommand:IRequest<bool>
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int PurchaseFormId { get; set; }

        /// <summary>
        /// 采购员
        /// </summary>
        [MaxLength(50)]
        public string Buyer { get; set; }

        /// <summary>
        /// 采购日期
        /// </summary>
        public DateTime? DateOfPurchase { get; set; }

        /// <summary>
        /// 羊只类型(1-种公,2-种母,3-后裔) 
        /// </summary>
        [MaxLength(50)]
        public string SheepType { get; set; }

        /// <summary>
        /// 供应商
        /// </summary>
        public string? VendorSnowId { get; set; }

        /// <summary>
        /// 仓库（羊场总仓库）
        /// </summary>
        [MaxLength(50)]
        public string Warehouse { get; set; }
        /// <summary>
        /// 单据号
        /// </summary>
        [MaxLength(50)]
        public string Document { get; set; }

        /// <summary>
        /// 流水号
        /// </summary>
        [MaxLength(50)]
        public string SerialNumber { get; set; }

        /// <summary>
        /// 批次/耳号
        /// </summary>
        [MaxLength(50)]
        public string BatchEarHorns { get; set; }

        /// <summary>
        /// 栋舍Id
        /// </summary>
        public int BuildingId { get; set; }

        /// <summary>
        /// 转入栏位Id
        /// </summary>
        public int ColumnId { get; set; }

        /// <summary>
        /// 性别 true男  false 女
        /// </summary>
        public bool? Gender { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [MaxLength(50)]
        public string? GoodName { get; set; }

        /// <summary>
        /// 标包
        /// </summary>
        [MaxLength(50)]
        public string? LabelPackage { get; set; }

        /// <summary>
        /// 计量单位
        /// </summary>
        [MaxLength(50)]
        public string? UnitOfMeasure { get; set; }

        /// <summary>
        /// 入库数量
        /// </summary>
        public int InboundQuantity { get; set; }

        /// <summary>
        /// 只均单元（元）
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal? AverageUnitOnly { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal Amount { get; set; }
        /// <summary>
        /// 单位折扣（元）
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal? UnitDiscounts { get; set; }

        /// <summary>
        /// 调整金额（元）
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal AdjustTheAmount { get; set; }

        /// <summary>
        /// 结算金额（元）
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal? SettlementAmount { get; set; }

        /// <summary>
        /// 总重量（公斤）
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal TotalWeight { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(200)]
        public string? PurchaseFormDesc { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        public SummaryEnum SummaryEnum { get; set; }


        /// <summary>
        /// 创建人
        /// </summary>
        [MaxLength(50)]
        public string? CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [MaxLength(50)]
        public string? UpdateBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 是否删除 true已删除  false未删除
        /// </summary>
        public bool IsDel { get; set; }

        /// <summary>
        /// 是否审核 true已审核  false未审核
        /// </summary>
        public bool IsAudit { get; set; }

        /// <summary>
        /// 是否仓库审核 true已审核  false未审核
        /// </summary>
        public bool IsWarehouse { get; set; }

    }
}
